package com.atguigu.day06.test;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/5 10:39
 * @注释
 */
public class DoubleArrayInit {
    public static void main(String[] args) {
        String[][] arr = {{"123", "456", "789"}, {"111", "222", "333"}};
        int[][] arr2 = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
        System.out.println("arr[1][2] = " + arr[1][2]);
        System.out.println("arr2[1][0] = " + arr2[1][0]);
        String[][] arr3 = new String[][]{{"1122334","5566778"}, {"加油努力"}, {"年薪百万"}};

        String[][] arr4 = new String[4][3];
        String[] arr5 = new String[]{"123", "456", "789"};
        String[] arr6 = new String[]{"111", "222", "333"};
        String[] arr7 = new String[]{"1111", "2222", "3333"};
        String[] arr8 = new String[]{"1122334", "5566778"};
        arr4[0] = arr5;
        arr4[1] = arr6;
        arr4[2] = arr7;
        arr4[3] = arr8;
        System.out.println("arr4[0][1] = " + arr4[0][1]);
        System.out.println("arr4[1][1] = " + arr4[1][1]);
        System.out.println("arr4[2][1] = " + arr4[2][1]);
        System.out.println("arr4[3][1] = " + arr4[3][1]);

        int[][]iArr = {{10, 11, 12, 13},{33, 44, 11, 55},{99, 88, 77, 23, 45}};
        for(int[] i:iArr){
            for(int j:i){
                System.out.print(j + " ");
            }
            System.out.println();
        }
    }
}
